With the increasing popularity of web-based applications, such as web services, more data is being organized, stored, transferred and displayed in structured documents such as Extensible Markup Language (XML) or HyperText Markup Language (HTML) files. For example, Business Process Execution Language (BPEL), based on XML, allows business processes and transactions to be specified in terms of web services. Elements in such structured documents are typically organized as nodes in a hierarchical or tree structure, which may be located using a location path from a root of the structure to the node to be located. Such a location path may use names of each node on the path. However the length of such name-based location path may increase rapidly as the names of the nodes on the location path increase, posing significant overhead in terms of both storage space and computing resource when the names of the nodes are long.